package swing;

import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class Login
{
    public static void main(String[] args)
    {
	JFrame frame = new JFrame("Login");
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	JPanel panel = new JPanel();
	panel.setLayout(new GridLayout(3, 2));

	JLabel label1 = new JLabel("User: ");
	JTextField textField = new JTextField(20);

	JLabel label2 = new JLabel("Password: ");
	JPasswordField passwordField = new JPasswordField(20);

	JButton button = new JButton("OK");

	panel.add(label1);
	panel.add(textField);
	panel.add(label2);
	panel.add(passwordField);
	panel.add(new JLabel(""));
	panel.add(button);

	frame.setContentPane(panel);

	// frame.pack();
	frame.setSize(300, 200);
	frame.setVisible(true);
    }
}
